package entity;

import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;

@Entity("order_item")
public class OrderItem {
    @Id
    private ObjectId id;
    private ObjectId orderId;
    private ObjectId productId;
    private Integer num;
    private Long price;
//    private Date orderTime;
    private String title;

    public OrderItem() {
    }

    public OrderItem(ObjectId id, ObjectId orderId, ObjectId productId, Integer num, Long price, String title) {
        this.id = id;
        this.orderId = orderId;
        this.productId = productId;
        this.num = num;
        this.price = price;
        this.title = title;
    }

    public OrderItem(ObjectId orderId, ObjectId productId, Integer num, Long price, String title) {
        this.id = id;
        this.orderId = orderId;
        this.productId = productId;
        this.num = num;
        this.price = price;
        this.title = title;
    }

    @Override
    public String toString() {
        return "OrderItem{" +
                "id=" + id +
                ", orderId=" + orderId +
                ", productId=" + productId +
                ", num=" + num +
                ", price=" + price +
                ", title='" + title + '\'' +
                '}';
    }

    public ObjectId getId() {
        return id;
    }

    public void setId(ObjectId id) {
        this.id = id;
    }

    public ObjectId getOrderId() {
        return orderId;
    }

    public void setOrderId(ObjectId orderId) {
        this.orderId = orderId;
    }

    public ObjectId getProductId() {
        return productId;
    }

    public void setProductId(ObjectId productId) {
        this.productId = productId;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Long getPrice() {
        return price;
    }

    public void setPrice(Long price) {
        this.price = price;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
}
